home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Testing & Debugging / Memory Management / Blat dcmd / Blat Release Notes next >
Encoding:
Text File  |  1993-09-17  |  6.1 KB  |  114 lines  |  [TEXT/MPS ]

  1.  
  2.     -----------Blat  dcmd------------
  3.     
  4.         Bo3b Johnson
  5.         
  6.         Version 3.        There was no prior general release.
  7.         
  8.         Version 5.  11/2/91    Fixed numerous bugs, and I'm sure there are more.  
  9.             Works with Macsbug Log now, and switching video pages.  
  10.             Fixes for VM not being installed, so that error checking works properly on IIx.
  11.             Tested on IIx and IIfx.
  12.             Seems to be incompatible with DAL.
  13.         
  14.     Introduction:
  15.         Blat is a dcmd that uses the MMU in order to catch references to memory locations
  16.         0 through 255.   That is, it will stop any program from reading or writing to the memory
  17.         that starts at zero, and is 256 bytes long.  That hunk of memory is reserved for Motorola,
  18.         and is used as the exception vectors for the CPU.   There is no data down there, and
  19.         cannot be, since it is used directly by the CPU.  This tool is then to catch any runtime
  20.         references to those locations and to stop in the debugger when they are seen.  Notably
  21.         this includes memory location 0 itself, which has been noted to be an evil location in
  22.         the past.  Think of Blat as a Super Gonzo Mr. Bus Error.
  23.             
  24.     Compatibility:
  25.         I've run it successfully on IIfx, IIx, SE/30, IIcx.
  26.         
  27.         It is not compatible with IIsi, IIci, LC or any computers using that ROM. 
  28.         It is not compatible with 040 class machines.
  29.         You have to have an MMU in order to use it.
  30.         You cannot use VM with Blat.
  31.         It is not compatible with TMon Pro.
  32.         Doesn't seem to be compatible with DAL (on IIx).
  33.         
  34.     Installing:
  35.         Copy the dcmd into your debugger prefs file and reboot.
  36.         
  37.         Notably, Blat will change the VBR register and install its own MMU tables when
  38.         it is installed, even if it isn't turned on.  This adds uncertainty to the machine,
  39.         so it is probably best to only have it installed when you are actively using it.
  40.         Typically when Blat screws up, the computer is wedged in a big way.  In addition,
  41.         it will slow your machine, since the tables are smaller, and bus errors are being
  42.         handled.  It is occasionally visibly slower, but probably around 10% overall.
  43.     
  44.     Use:
  45.         The Blat command line is:
  46.         Blat   Off | Writes | Both | Dump | Ignore $xxx ... | IP | IL | Learn | Auto | Status
  47.  
  48.         'Blat Writes' will turn on memory protection for writes to 0..255, and will stop 
  49.         whenever any code changes that memory.  Blat will automatically give you an
  50.         IP around the offending code so you can inspect it.  Realize that you have stopped
  51.         in Blat, and not in the offending code, so the registers and the stack are not correct
  52.         for the code that is disassembled.  
  53.         
  54.         'Blat Off' will turn the memory protection off, so that no errors are reported.  As
  55.         an implementation detail, the MMU is still active and catching writes to that
  56.         page, it just isn't being reported.  I do this so that I can keep the VBR based copy
  57.         of the vectors up to date.  
  58.         
  59.         'Blat Both' will catch reads and writes both.  I think this is cool, and I hope you do
  60.         too, since it was brought to you at great expense.  Whenever any code touches that
  61.         page, it will be busted, and displayed in a similar way.  While testing it I've seen a
  62.         lot of code that fools around down there, that has no business doing so.  You will
  63.         see this as soon as you try to use a menu with Both turned on.  Any reason why 
  64.         the MDEF needs to read memory location 4?
  65.         
  66.         As you use Blat, you will find that it catches everything, including legitimate
  67.         system code that installs a temporary bus error handler.  Those bus errors happen,
  68.         and are caught by the system.  Writing to memory location 8 is the most likely
  69.         candidate in the system.  Nearly all are legitimate, but I don't special case them
  70.         so they can be seen.  This is obnoxious though, since you cannot make any
  71.         progress with Blat firing every few microseconds.  The rest of the features are
  72.         to deal with this problem.  
  73.         
  74.         'Blat Ignore $40803322' will ignore any bus errors that originate when the PC is
  75.         at that address.  You can ignore a specific address, or a set of addresses.  They are
  76.         added to a an internal Blat table and any references are no longer reported from
  77.         that address.  There is a maximum of 50 addresses that Blat will ignore.  If you
  78.         want more, that's why I'm giving you the source code.
  79.         
  80.         'Blat Dump' will give you a list of all of the addresses that Blat is ignoring.  These
  81.         are not saved over boot, so you have to build a new table each time.
  82.         
  83.         'Blat Learn' helps to build a new table.  If Blat is turned on, then it will automatically
  84.         ignore the address for each error as it happens.  This essentially lets you see the
  85.         error once, then it will be ignored from that point on.  Blat will tell you that it is 
  86.         learning the address, to let you know that you won't be hassled with that particular
  87.         address from that point on.
  88.         
  89.         'Blat Auto' is an even handier version of automatic learning.  It will presume that
  90.         all bus errors it sees are legitimate, and will put them in the ignore table, and not
  91.         display them either.  They are written to the Macsbug screen, so you can see them,
  92.         but they won't stop.  Once you understand how it works and examine all the
  93.         bus errors that are displayed, this is the easiest way to fill the ignore buffer with
  94.         the legitimate addresses.  Unfortunately, some relocatable system code has bugs,
  95.         so they will move around and cause a few false alarms.  The CDEF is this way too.
  96.         
  97.         'Blat IP' or 'Blat IL' will change the form of automatic disassembly that Blat shows
  98.         for each error.  Each chooses the command that Blat issues to Macsbug.
  99.         
  100.         'Blat Status' will show you the state of the various flags that these options control,
  101.         so you can see the exact setup.   Learn and Auto are mutually exclusive for example,
  102.         and neither of those actually turn Blat on.
  103.             
  104.         I've included the source in case it is helpful.  If you run into a situation that seems
  105.         to require changing the MMU tables or the bus error handler, you should contact
  106.         me instead of doing the work yourself.  The reason is simple: the only indication 
  107.         you get when something goes wrong is the machine is hung.  This makes it fairly
  108.         hard to debug, and I already have done so.  The source includes some of those
  109.         situations as comments.
  110.  
  111.             Bo3b.        
  112.         
  113.         
  114.